module D_FF (clk, reset, d, q);

input  clk, d, reset;
output q;
reg    q;

always @ (posedge clk or negedge reset)
    if (!reset) // 异步负边沿复位
        q <= 0;
    else 
        q <= d;

endmodule
